import PageTools from '@/components/PageTools'
import ImageUpload from '@/components/ImageUpload'
import WorkCalendar from '@/components/WorkCalendar'
import ScreenFull from '@/components/ScreenFull'
import Lang from '@/components/Lang'
import TagsView from '@/components/TagsView'
import ThemePicker from '@/components/ThemePicker'
import store from '@/store'
export default {
  install(Vue) {
    Vue.component(PageTools.name, PageTools)
    Vue.component(ImageUpload.name, ImageUpload)
    Vue.component(WorkCalendar.name, WorkCalendar)
    Vue.component(ScreenFull.name, ScreenFull)
    Vue.component(Lang.name, Lang)
    Vue.component(TagsView.name, TagsView)
    Vue.component(ThemePicker.name, ThemePicker)
    Vue.prototype.$aa = function() {
      console.log('哈哈')
    }
    Vue.prototype.check = function(point) {
      // 如果point在权限中，那这个按钮就应该显示出来
      return store.state.user.userInfo.roles?.points.some(item => item.toLowerCase() === point.toLowerCase())
    }
  }
}
